﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:viewmodel="clr-namespace:MobiSms.ViewModel;assembly=MobiSms.ViewModel"
    xmlns:UX="clr-namespace:MobiSms.UX;assembly=MobiSms.UX"
    xmlns:radControlPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Class="MobiSms.Wasun.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <Grid x:Name="LayoutRoot">
        <Grid.DataContext>
            <viewmodel:HomeViewModel/>
        </Grid.DataContext>
        <Grid.Background>
            <ImageBrush ImageSource="{Binding GlobalSettings.BackgroundImage}" Stretch="{Binding GlobalSettings.BackgroundImageStretch}" />
        </Grid.Background>

        <controls:Panorama>
            <controls:Panorama.Title>
                <StackPanel Margin="12,76,0,0" Orientation="Horizontal">
                    <Image Source="{Binding LogoUri, Mode=OneWay}"/>
                    <StackPanel VerticalAlignment="Bottom">
                        <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Text="{StaticResource IDS_APP_SUBTITLE}"/>
                        <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="Ver 1.0 beta"/>
                    </StackPanel>
                </StackPanel>
            </controls:Panorama.Title>
            <controls:PanoramaItem Header="{StaticResource IDS_HOME_DASH}">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <toolkit:WrapPanel>
                                <radControlPrimitives:RadCycleHubTile Margin="12,0,0,12" 
                                                                      Width="354" 
                                                                      Title="{StaticResource IDS_HOME_NEWREPLY}" 
                                                                      UpdateInterval="0:0:3"
                                                                      Tap="GotoViews"
                                                                      ItemsSource="{Binding ItemsOfUnreadReply}"
                                                                      Tag="/Views/ReplyCollection.xaml">
                                    <radControlPrimitives:RadCycleHubTile.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel>
                                                <TextBlock Style="{StaticResource PhoneTextTitle3Style}" 
                                                           Foreground="{StaticResource PhoneChromeBrush}" 
                                                           Text="{Binding Mobile}" Margin="12,6"/>
                                                <TextBlock Style="{StaticResource PhoneTextNormalStyle}" 
                                                           Text="{Binding DisplayContent}" 
                                                           TextWrapping="Wrap"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </radControlPrimitives:RadCycleHubTile.ItemTemplate>
                                </radControlPrimitives:RadCycleHubTile>
                                <radControlPrimitives:RadHubTile Margin="12,0,0,12"
                                                                 Title="{StaticResource IDS_HOME_PEOPLE}" 
                                                                 Count="{Binding Path=RecentBirthdayContacts}" 
                                                                 Tag="/Views/RecentBirthdayView.xaml"
                                                                 Tap="GotoViews"
                                                                 ImageSource="/Assets/CakeIcon.png"  />
                                <radControlPrimitives:RadPictureRotatorHubTile Margin="12,0,0,12" 
                                                                               Width="171"
                                                                               Tag="/Views/MessageComposeView.xaml"
                                                                               Title="{StaticResource IDS_HOME_COMPOSE}" 
                                                                               Tap="GotoViews" UpdateInterval="00:00:03">
                                    <System:String>Assets\ComposeIcon.png</System:String>
                                </radControlPrimitives:RadPictureRotatorHubTile>
                            </toolkit:WrapPanel>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </controls:PanoramaItem>
            
            <controls:PanoramaItem Header="{StaticResource IDS_HOME_MENU}">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_SERIAL}" Uri="/Views/SerialCollectionView.xaml"/>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_HISTORY}" Uri="/Views/MessageCollectionView.xaml"/>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_REPLY}" Uri="/Views/ReplyCollection.xaml"/>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_PREFERENCE}" Uri="/Views/PreferenceView.xaml"/>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_ABOUTHELP}" Uri="/Views/AboutAndHelpView.xaml"/>
                            <UX:UXTextMenu Content="{StaticResource IDS_HOME_MENU_USERMANUAL}" Uri="/Views/UserManualView.xaml"/>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </controls:PanoramaItem>
        </controls:Panorama>

    </Grid>

</phone:PhoneApplicationPage>